Add some test for draw_drawable graphics exposures
authorAlexander Larsson <alexl@redhat.com>
Wed, 27 May 2009 15:09:56 +0000 (17:09 +0200)
committerAlexander Larsson <alexl@redhat.com>
Wed, 27 May 2009 15:10:37 +0000 (17:10 +0200)
tests/testwindows.c

index 842f8566a31a61132ffc496bf74f5b86595d1e6e..37bd74049a73dc85f0ee9fc371f821b457f966df 100644 (file)
@@ -221,6 +221,22 @@ add_window_clicked (GtkWidget *button,
   update_store ();
 }
 
+static void
+draw_drawable_clicked (GtkWidget *button, 
+                      gpointer data)
+{
+  GdkGC *gc;
+  gc = gdk_gc_new (darea->window);
+  gdk_draw_drawable (darea->window,
+                    gc,
+                    darea->window,
+                    -15, -15,
+                    40, 70,
+                    100, 100);
+  g_object_unref (gc);
+}
+
+
 static void
 remove_window_clicked (GtkWidget *button, 
                       gpointer data)
@@ -990,6 +1006,16 @@ main (int argc, char **argv)
                             2, 3);
   gtk_widget_show (button);
 
+  button = gtk_button_new_with_label ("draw drawable");
+  gtk_box_pack_start (GTK_BOX (vbox),
+                     button,
+                     FALSE, FALSE,
+                     2);
+  gtk_widget_show (button);
+  g_signal_connect (button, "clicked", 
+                   G_CALLBACK (draw_drawable_clicked), 
+                   NULL);
+
   button = gtk_button_new_with_label ("Add window");
   gtk_box_pack_start (GTK_BOX (vbox),
                      button,